package mobi.bantu.service.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import mobi.bantu.bean.Page;
import mobi.bantu.dao.mapper.SecUserMapper;
import mobi.bantu.bean.SecUser;
import mobi.bantu.service.SecUserService;

/**
 * Created by qiao on 2017/5/3.
 */
@Service
public class SecUserServiceImpl implements SecUserService {

    @Autowired
    private SecUserMapper secUserMapper;

    @Override
    public Page<SecUser> page(Map<String, Object> param) {
        return Page.create(secUserMapper.list(param),secUserMapper.count(param));
    }

    @Override
    public SecUser getByname(String username) {
        return secUserMapper.getByname(username);
    }

    @Override
    public int delete(Long id) {
        return secUserMapper.delete(id);
    }

    @Override
    public int save(SecUser user) {
        return secUserMapper.create(user);
    }

    @Override
    public SecUser getById(Long id) {
        return secUserMapper.get(id);
    }

    @Override
    public int update(SecUser user) {
        return secUserMapper.update(user);
    }


}
